package zm.irc.util;

import zm.irc.ioc.annotation.Service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

@Service
public class TianXinUtil {
    
    public String getContent(String tianXinRespStr){
        String msgContent = "";
        JSONObject msgObj = JSON.parseObject(tianXinRespStr);
       // String code = msgObj.getString("code")
        String newsList = msgObj.getString("newslist");
        JSONArray contentArray = JSON.parseArray(newsList);
        JSONObject content = contentArray.getJSONObject(0);
        msgContent = content.getString("content");

        return msgContent;
    }
}
